import { initMixin } from "./init";
import { stateMixin } from "./state";
import { renderMixin } from "./render";
import { eventsMixin } from "./events";
import { lifecycleMixin } from "./lifecycle";
import { warn } from "../util/index";

function Vue(options) {
  // 是否用new 出来的 没有就给警告，函数调用有5种方式
  if (process.env.NODE_ENV !== "production" && !(this instanceof Vue)) {
    warn("Vue is a constructor and should be called with the `new` keyword");
  }
  this._init(options);
}

initMixin(Vue); // 挂载初始化方法
stateMixin(Vue); //挂载 状态处理方法
eventsMixin(Vue); //挂载 事件方法
lifecycleMixin(Vue); //挂载生命周期
renderMixin(Vue); //挂载与渲染有关的方法

export default Vue;
